package com.dd.cloud.user.mapper.chknowl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.dd.cloud.user.entity.chknowl.ChknowlChDrugs;
import com.dd.cloud.user.req.chknowl.ChDrugsQueryReq;
import com.dd.cloud.user.res.chknowl.*;
import com.dd.cloud.common.mybatis.RootMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 古籍中药材 Mapper 接口
 * </p>
 *
 * @author czg
 * @since 2022-07-04
 */
public interface ChknowlChDrgusMapper extends RootMapper<ChknowlChDrugs> {

    /**
     * 分页查询中药材
     * @param iPage
     * @param req
     * @return
     */
    IPage<ChknowlChDrugsPageRes> getChDrugsPage(@Param("iPage") IPage iPage, @Param("req") ChDrugsQueryReq req);

    /**
     * 查询中药材 关键字查询
     *
     * @param keyword
     * @return
     */
    List<ChUserSearchListRes> getChDrugsListByKeyword(@Param("keyword") String keyword);

    /**
     * id查询中成药详情
     * @param id
     */
    ChknowlChDrugsDetailRes getChDrugsDetailById(Integer id);

    /**
     * 查询已存在的中药材
     * @param nameStr
     * @return
     */
    List<String> getChknowlChDrugsNameIsExists(@Param("nameStr") List<String> nameStr);

    /**
     * 查询分类
     * @param oneCategoryIdStr
     * @param twoCategoryIdStr
     * @return
     */
    List<ChkonwlDrugsRes> queryCategoryList(@Param("oneCategoryIdStr") String oneCategoryIdStr,
                                            @Param("twoCategoryIdStr") String twoCategoryIdStr);

    /**
     * 查询药品
     * @param natureArray
     * @param flavourArray
     * @param tropismArray
     * @return List<ChknowlChDrugs>
     */
    List<ChknowlChDrugs> queryDrugsList(@Param("natureArray") String[] natureArray,
                                        @Param("flavourArray") String[] flavourArray,
                                        @Param("tropismArray") String[] tropismArray);
    /**
     * 查询药品
     * @param flavours
     * @param natures
     * @param tropisms
     * @return List<ChknowlChDrugs>
     */
    List<ChknowlChDrugs> queryDrugsListById(@Param("natures") String natures,
                                            @Param("flavours") String flavours,
                                            @Param("tropisms") String tropisms);
}
